package org.feng.test;

import org.feng.clog.ProcessorContext;
import org.feng.clog.enums.ActionTypeEnum;
import org.feng.clog.utils.ManagerUtil;
import org.springframework.stereotype.Component;

/**
 * 订单管理
 *
 * @author feng
 */
@Component
public class OrderManager {

    /**
     * 创建订单
     */
    public Boolean createOrder(OrderCreateReq req) {
        ProcessorContext<OrderCreateReq> processorContext = new ProcessorContext<>();
        processorContext.setAction(ActionTypeEnum.ORDER_CREATE);
        processorContext.setData(req);
        return ManagerUtil.handle(processorContext);
    }
}
